from django.conf.urls.defaults import *
from django.contrib import admin
from willconta.transfers import views
from willconta.users.views import *
from django.contrib.auth.views import login, logout

admin.autodiscover()

anio = '(\d{4})'
dia = '(\d{2})'
mes = '(\d{2})'
fecha_es = dia + '-' + mes + '-' + anio
fecha_en = anio + '-' + mes + '-' + dia

urlpatterns = patterns('',
    (r'^search-form/$', views.search),
    (r'^willconta/movimiento/new/' , requires_login(views.create_mov)),
    (r'^willconta/movimientos/edit/[0-9]*' , requires_login ( views.create_mov)),
    (r'^willconta/movimientos/'+fecha_es+'/'+fecha_es , 'get_movimientos'),
    (r'^willconta/movimientos/'+fecha_en+'/'+fecha_en , 'get_movimientos_en'),
    #requires_login(my_view1)
    (r'^meta/' , 'display_meta'),
    (r'^accounts/login/$', login),
    (r'^accounts/logout/$', logout),
    (r'^accounts/profile/$', profile),

    # Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
    # to INSTALLED_APPS to enable admin documentation:
    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),
    (r'^admin/', include(admin.site.urls)),
)
